<!DOCTYPE html>
<!-- saved from url=(0056)https://devtrainingcenter.gameloft.org/Home/progress/264 -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Training Center -  Page title </title>
                
        <link href="./Training Center - Page title_files/css" rel="stylesheet" type="text/css">
        <!--<base href="https://devtrainingcenter.gameloft.org/">--><base href=".">
        
        <link rel="stylesheet" href="./Training Center - Page title_files/jquery-ui.css" type="text/css">
        <link rel="stylesheet" href="./Training Center - Page title_files/hallo.css" type="text/css">
        <link rel="stylesheet" href="./Training Center - Page title_files/main.css" type="text/css">
        <link rel="stylesheet" href="./Training Center - Page title_files/gantt-chart.css" type="text/css">
        <link rel="stylesheet" href="./Training Center - Page title_files/animate.css" type="text/css">
        <link rel="stylesheet" href="./Training Center - Page title_files/jquery.datepicker.css" type="text/css"> 
        <link rel="stylesheet" href="./Training Center - Page title_files/jquery.gridview.css" type="text/css"> 
        <link rel="stylesheet" href="./Training Center - Page title_files/jquery.dialog.css" type="text/css"> 
        <script src="./Training Center - Page title_files/jquery-min.js" type="text/javascript"></script>
        <script src="./Training Center - Page title_files/jquery-ui.min.js"></script>
        <script src="./Training Center - Page title_files/rangy-core.js" type="text/javascript"></script>
        <script src="./Training Center - Page title_files/hallo.js" type="text/javascript"></script>
        <script src="./Training Center - Page title_files/jquery.datepicker.js" type="text/javascript"></script> 
        <script src="./Training Center - Page title_files/jquery.dialog.js" type="text/javascript"></script> 
        <script src="./Training Center - Page title_files/jquery.gridview.js" type="text/javascript"></script> 
        <script src="./Training Center - Page title_files/jquery.paste.js" type="text/javascript"></script>
        <script src="./Training Center - Page title_files/Application.js" type="text/javascript"></script> 
        <script src="./Training Center - Page title_files/Remote.js" type="text/javascript"></script> 
        <script src="./Training Center - Page title_files/Combobox.js" type="text/javascript"></script> 
        <script>
    var userId = "175";
    var $taskService = new RemoteObject("Task");
    var $homeService = new RemoteObject("Home");
    var $selectedTaskId = 0;
    var $startDate = new Date("2014-11-26 00:00:00");
    var $groupId = 81;
      
    function submitAnswer(questionId) 
    {
        var selections = $("#" + questionId + "Question input");
        var answer = new Array(selections.length);
        
        for (var i = 0; i < selections.length; i++) 
        {
            answer[i] = selections[i].checked;
        }
        
        answer = JSON.stringify(answer);
        $("#" + questionId + "Question").addClass("loading");
        
        var commitAnswer = $taskService.getAction("commitAnswer");
        commitAnswer.onLoad = commitAnswerFinish;
        commitAnswer.invoke(questionId, answer);
        
    }
    
    function commitAnswer(element)
    {
        $(element).addClass("loading");
        var commitAnswer = $taskService.getAction("commitAnswer");
        commitAnswer.onLoad = commitAnswerFinish;
        commitAnswer.invoke(element.id, element.innerHTML);
    }
    
    /**
     * Finish the task 
     */
    function finishTask(id, checkbox)
    {
        checkbox.disabled = true;
        var finishTaskAction = $taskService.getAction("finishTask");
        finishTaskAction.invoke(id);
    }
    
    /**
     * Get task handler
     */
    function getTaskHandler(data)
    {
        if (data["state"]) {
            // task state
            if (data["state"].state == 0) {
                $("#task-details .progress").html("Quest is in progress...");            
            } else if (data["state"].state == 1) {
                $("#task-details .progress").html("Trainer is reviewing your work.");
            } else if (data["state"].state == 2) {
                $("#task-details .progress").html("You've earned " + data["state"].point + " <i class='icon coin'></i> this Quest. You need to finish all coding reviews.");
            } else {
                $("#task-details .progress").html("Quest over. You've earned " + data["state"].point + " <i class='icon coin'></i> for this Quest.");
            }
        }
        
        var isEditable = data["state"] && (data["state"].state == 0);
        
        if (isEditable) {
            $("#task-details .finish").show();
        } else {
            $("#task-details .finish").hide();
        }
        
        $("#task-details .name").html(data.name);
        $("#task-details .description").html(data.description);
        
        if (data.link)
        {
            $("#task-details .link").html(data.link).show('fast');        
        }
        else
        {
            $("#task-details .link").hide('fast');
        }
        
        showTasks('#task-details .theory', 'theoryTasks', data.theoryTasks, "theory#" + data.id + "#" + userId);
        showQuestions(data.questions, isEditable);
        
        if (data.exercise) 
        {
            $("#task-details .exercise.content").html(data.exercise);
            $("#task-details .exercise").show();
        }
        else
        {
            $("#task-details .exercise").hide();
        }
        
        showTasks('#task-details .exercise-tasks', 'exerciseTasks', data.exerciseTasks, "exercise#" + data.id + "#" + userId);
        $("#task").removeClass("leftonly");

        showCodingReviews('#task-details .code-reviews', data.reviews);
        
        $(".container .right .editor").hallo({
            plugins: {
              'halloformat': {},
              'halloblock': {},
              'hallojustify': {},
              'hallolists': {},
              'halloreundo': {}
            }
          });
    }
    
    /**
     * Coding review
     */
    function showCodingReviews(selector, reviews) {
        $(selector).html("");
        
        $(reviews).each(function(index, review) {
            $(codeReviewHTML(review)).appendTo(selector);
        });
    }
       
    function codeReviewHTML(review) {
        var checked = (review.state == 1 || review.state == 3) ? " checked='checked' disabled='disabled' " : "";
        var openCount = review.openCount > 0 ? "<span style='color:red'>(" + review.openCount + ")</span> " : "";
        return "<div class=\"review\">"
               + "<div class=\"review-category\"></div>"
               + "<div class=\"review content\">" + review.content + "</div>"
               + "<div class=\"review-state client\">"
               + "<input id='review" 
                + review.id + "' type='checkbox' " + checked + "onchange='finishCodeReviewClicked(" + review.id + ", this)' />"
               + "<label for='review" + review.id + "'>" + openCount + "I've finished this</label></div>"
               + "</div>";
    }
    
    function showTasks(selector, name, tasks, commentId) 
    {
        // theory tasks
        var tasksHTML = "";
        for (index in tasks) 
        {
            var task = tasks[index];
            if (task.checked) 
            {
                tasksHTML += "<div class='item'><input type='checkbox' checked='checked' /><label for='" + name + index + "'>" + task.name + "</label></div>";
            }
            else
            {
                tasksHTML += "<div class='item'><input type='checkbox' id='" + name + index +"' onchange='finishTask(" + task.id + ", this);'/><label for='" + name + index + "'>" + task.name + "</label></div>";
            }
        }
        
        if (tasksHTML === "")
        {
            $(selector).hide();
        }
        else
        {
                    
            $(selector).show();
            $(selector + ".content").html(tasksHTML);
        }
        
    }   
    
    function commitAnswerFinish(data)
    {
        $(".container .right .loading").removeClass("loading");
    }
    
    function showQuestions(questions, isEditable)
    {
        var questionHTML = "";
        
        for (index in questions) {
            var question = questions[index];
            questionHTML += "<div class='question'>";
            questionHTML += "<div class='ask'><span class='number'>#" + (parseInt(index) + 1) + "</span>" + question.content + "</div>";
            questionHTML += "<div class='answer'>";
            
            if (question.choices) 
            {
                var choices = JSON.parse(question.choices);
                var answer = JSON.parse(question.answer);
                questionHTML += "<div id='" + question.id + "Question'>";
                for (var selection in choices) 
                { 
                    
                    var checked = "";
                    if (answer && answer[selection]) 
                    {
                        checked = " checked='checked' ";
                    }
                    
                    if (isEditable) {
                        questionHTML += "<div class='item'><input onchange='submitAnswer(" 
                                    + question.id 
                                    + ")' type='checkbox' id='selection" 
                                    + index 
                                    + selection 
                                    + "' " 
                                    + checked 
                                    + " /><label for='selection" 
                                    + index 
                                    + selection 
                                    + "'>" 
                                    + choices[selection] + "</label></div>";
                    } else {
                        questionHTML += "<div class='item'><input type='checkbox' id='selection" 
                                    + index 
                                    + selection 
                                    + "' " 
                                    + checked 
                                    + " disabled='disabled' /><label for='selection" 
                                    + index 
                                    + selection 
                                    + "'>" 
                                    + choices[selection] + "</label></div>";
                    }
                }
                questionHTML += "</div>";
            } 
            else 
            {
                if (!question.answer) 
                {
                    question.answer = "";
                }      
                
                if (isEditable) {
                
                    questionHTML += "<div class='editor' id='" 
                            + question.id 
                            + "answer' onblur='commitAnswer(this);'>" 
                            + question.answer 
                            + "</div>";
                } else {
                    questionHTML += "<div class='answer' id='" 
                            + question.id 
                            + "answer'>" 
                            + question.answer 
                            + "</div>";
                }
            }
            
            questionHTML += "</div>";
            questionHTML += "</div>";
        }
        
        if (questionHTML === "")
        {
            $("#task-details .questions").hide();
        }
        else
        {
            $("#task-details .questions").show();
            $("#task-details .questions.content").html(questionHTML);
        }                
    }
    
    function hideRight() {
        $("#task").addClass("leftonly");
    }
    
    function showTask(id)
    {
        $selectedTaskId = id;
        var action = $taskService.getAction("getTask");
        action.onLoad = getTaskHandler;
        action.invoke(id);
    }
    
    function finishTaskClicked() {
        new Dialog("Are you sure to finish?", "You will not be able to edit your answer and trainer will be notified.", ["No", "Yes"], function (selectedOption) {
           if (selectedOption) {
               var action = $homeService.getAction("finishTask");
                action.onLoad = finishTaskHandler;
                action.invoke($selectedTaskId, $groupId);
           }
        });
    }
    
    /**
     * Finish the task
     */
    function finishTaskHandler(data) {
        if (data.success) {
            window.location.reload();
        }
    }
    
    /**
     * Finish the code reviewk
     */
    function finishCodeReviewClicked(codeReviewId, item) {
        item.disabled = true;
        var finishCodeReviewAction = $homeService.getAction("finishCodeReview");
        finishCodeReviewAction.invoke(codeReviewId);
    }
</script>
                
    </head>
    <body>
        <div id="wrapper">            
            <div id="navigator" onclick="switchLayout();">
                                                        <ul class="buttons">
                        <li><a href="https://devtrainingcenter.gameloft.org/##">Le Khac Tho</a></li>
                                                <li><a href="https://devtrainingcenter.gameloft.org/###">Reports</a></li>
                        <li><a href="https://devtrainingcenter.gameloft.org/?action=logout">Log out</a></li>
                    </ul>
                                                    <div class="logo">
                    <i class="icon adminpanel"></i>
                    <span class="text">Training Center</span>
                </div>
            </div>
                        <div id="subnavigation">
                &nbsp;
            </div>
                        

<div id="left-panel">
    <div class="statistic" onclick="switchLayout();">
        <span class="title">
            <i class="icon group">&nbsp;</i>
            <span class="text">Your Progress</span>            
        </span>
        <div class="info">
            <div><span class="number">54<i class="icon coin"></i></span> Average</div>
            <span class="number">8</span> Achievements
            <div style="color: red">DCG019</div>
        </div>
    </div>        
</div>

<div id="right-panel">
    <div class="box">
    <div class="title" onclick="hideRight()">
        <span>
            <i class="icon task">&nbsp;</i>
            My Quests for <b>DCG019</b> - <b>C++ Training Course.</b>
        </span>        
    </div>
    <div class="content controller-box tabbar">
    	<a class="tab">Display:
  		</a><a onclick="toogleClass(this, &quot;hide-details&quot;)" class="tab active">Details
  		</a><a onclick="toogleClass(this, &quot;hide-theory&quot;)" class="tab active">Theory
  		</a><a onclick="toogleClass(this, &quot;hide-questions&quot;)" class="tab active">Questions
  		</a><a onclick="toogleClass(this, &quot;hide-exercise&quot;)" class="tab active">Exercise
  		</a><a onclick="toogleClass(this, &quot;hide-codereview&quot;)" class="tab active">Code Review
  		</a><a onclick="toogleClass(this, &quot;hide-finished&quot;)" class="tab active">Finished
  		</a><a onclick="toogleClass(this, &quot;hide-closed&quot;)" class="tab active">Closed</a>
    </div> 
    <div class="content" style="padding: 0px">
        <div class="container" id="task">
            <div class="left">
                <div class="table">
                                        <div class="item state0" onclick="showTask(36);">
                        <div class="column id">#1</div>
                                                <div class="column no-codereview">&nbsp;</div>
                                                <div class="column string bold">Getting started</div>
                        <div class="column string bold autohide" style="text-align: right; min-width: 50px; max-width: 150px; padding: 0px"><div class="datepicker disabled hideYear" title="undefined"><div class="day">Wed</div><div class="date">26</div><div class="month">NOV</div><input class="dateinput" value=""></div></div>
                    </div>
                                        <div class="item state1" onclick="showTask(14);">
                        <div class="column id">#2</div>
                                                <div class="column no-codereview">&nbsp;</div>
                                                <div class="column string bold">Do Tictactoe game</div>
                        <div class="column string bold autohide" style="text-align: right; min-width: 50px; max-width: 150px; padding: 0px"><div class="datepicker disabled hideYear" title="undefined"><div class="day">Thu</div><div class="date">27</div><div class="month">NOV</div><input class="dateinput" value=""></div></div>
                    </div>
                                        <div class="item state1" onclick="showTask(62);">
                        <div class="column id">#3</div>
                         
                        <div class="column unfinished-task">6</div>
                                                <div class="column string bold">Theory training</div>
                        <div class="column string bold autohide" style="text-align: right; min-width: 50px; max-width: 150px; padding: 0px"><div class="datepicker disabled hideYear" title="undefined"><div class="day">Fri</div><div class="date">28</div><div class="month">NOV</div><input class="dateinput" value=""></div></div>
                    </div>
                                        <div class="item state0" onclick="showTask(63);">
                        <div class="column id">#4</div>
                                                <div class="column no-codereview">&nbsp;</div>
                                                <div class="column string bold">Physic Engine</div>
                        <div class="column string bold autohide" style="text-align: right; min-width: 50px; max-width: 150px; padding: 0px"><div class="datepicker disabled hideYear" title="undefined"><div class="day">Tue</div><div class="date">2</div><div class="month">DEC</div><input class="dateinput" value=""></div></div>
                    </div>
                                        
                </div>
            </div><div class="right">
                <div class="box" id="task-details">                    
                    <div class="title name">Theory training</div>                    
                    <div class="content progress" style="border-bottom: 1px solid lightgray;">Trainer is reviewing your work.</div>
                    <div class="content description"><p class="MsoNormal">For theory training, you will join the presentation with
trainers in around 2.5 hour for each ½ day. The left time is to do small
exercises.<o:p></o:p></p>

<p class="MsoNormal">Small exercises will be committed here:<o:p></o:p></p>

<p class="MsoNormal">https://saiwks1380.sai.gameloft.org/svn/glvndevtraining/&lt;YOUR_STUDIO&gt;/&lt;YOUR_GROUP_ID&gt;
<o:p></o:p></p>

<p class="MsoNormal">/&lt;YOUR_NAME&gt;/C++/SmallExercises/trunk<o:p></o:p></p>

<p class="MsoNormal">Ex:<o:p></o:p></p>

<p class="MsoNormal">https://saiwks1380.sai.gameloft.org/svn/glvndevtraining/sai/S3G034/huy.vuquang/C++/SmallExercises/trunk<o:p></o:p></p><p class="MsoNormal"><br></p></div>                    
                    <div class="content link" style="">\\sai-data01\Documents\Specialized\Programming\Training\01. HD_Training\01. General Training\New C++\SmallPracticeExercises</div>
                    <div class="title theory">Theory Checklist</div>
                    <div class="content theory"><div class="item"><input type="checkbox" checked="checked"><label for="theoryTasks0">Array vs pointer</label></div><div class="item"><input type="checkbox" checked="checked"><label for="theoryTasks1">Dynamic allocation vs static allocation</label></div><div class="item"><input type="checkbox" checked="checked"><label for="theoryTasks2">Stack and Heap</label></div><div class="item"><input type="checkbox" checked="checked"><label for="theoryTasks3">Constructor vs Destructor</label></div><div class="item"><input type="checkbox" checked="checked"><label for="theoryTasks4">Virtual function in C++</label></div><div class="item"><input type="checkbox" checked="checked"><label for="theoryTasks5">Abstract class and pure function in C++</label></div><div class="item"><input type="checkbox" checked="checked"><label for="theoryTasks6">Dynamic binding and static binding</label></div><div class="item"><input type="checkbox" checked="checked"><label for="theoryTasks7">Virtual destructor</label></div></div>
                    <div class="title questions" style="display: none;">Theory Questions</div>
                    <div class="content questions" style="display: none;"></div>
                    <div class="title exercise">Exercise</div>
                    <div class="content exercise"><p class="MsoNormal"><span class="MsoIntenseEmphasis"><span style="font-size:14.0pt;
mso-bidi-font-size:11.0pt;line-height:115%">Introduction<o:p></o:p></span></span></p>

<p class="MsoTocHeading"><span style="font-size: 11pt; line-height: 115%; font-family: Calibri, sans-serif; color: windowtext;">This exercise
relates to OOP design and the content relates to the relationship between
Patient and Virus inside patient.<o:p></o:p></span></p>

<img class="" src="./Training Center - Page title_files/1399631222.jpg"><div><br>

<w:sdt sdtdocpart="t" docparttype="Table of Contents" docpartunique="t" id="373511800">
 <p class="MsoTocHeading"><br></p>
 <p class="MsoNormal"><!--[if supportFields]><b><span style='mso-no-proof:yes'><span
 style='mso-element:field-end'></span></span></b><![endif]--><o:p>&nbsp;</o:p></p>
</w:sdt>

<h1 style="text-indent:-.25in;mso-text-indent-alt:-.25in;mso-list:l10 level1 lfo1"><a name="_Toc387246615"><!--[if !supportLists]-->&nbsp; &nbsp;I.<span style="font-weight: normal; font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><!--[endif]-->REQUIREMENT – IMPLEMENT THE RELATIONSHIP BETWEEN
PATIENT AND VIRUS</a><o:p></o:p></h1>

<h2><a name="_Toc387246616"><!--[if !supportLists]-->1.<span style="font-weight: normal; font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;
</span><!--[endif]-->Create a ATGX.bin file using notepad++, copy
this text to the file:</a><o:p></o:p></h2>

<p class="MsoNormal" style="margin-left:.25in">ATGXXGTAAXGTTAGXXGTAATXGATGXXGTAAXGTTAGXXGTAATXG<o:p></o:p></p>

<p class="MsoNormal" style="margin-left:.25in">You will have something like this<o:p></o:p></p>

<p class="MsoNormal" style="margin-left:.25in"><img class="" src="./Training Center - Page title_files/1399631249.jpg"><o:p></o:p></p>

<p class="MsoNormal" style="margin-left:.25in">Save the file.<o:p></o:p></p>

<h2><a name="_Toc387246617"><!--[if !supportLists]-->2.<span style="font-weight: normal; font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;
</span><!--[endif]-->Design class represent the relationship of
Patient and Virus (Flu Virus and Dengue virus)</a><o:p></o:p></h2>

<h3><a name="_Toc387246618"><!--[if !supportLists]-->a)<span style="font-weight: normal; font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;
</span><!--[endif]-->About Virus:</a><o:p></o:p></h3>

<p class="MsoListParagraphCxSpFirst" style="margin-left:.75in;mso-add-space:auto;
text-indent:-.25in;mso-list:l7 level1 lfo4"><!--[if !supportLists]--><span style="font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings">v<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;
</span></span><!--[endif]-->The virus has attributes to store the details:<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l11 level1 lfo5"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->char* m_dna: to store the order of acid nucleic
sequence (A, T, G, X).<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l11 level1 lfo5"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->int m_resistance: the virus resistance ability
(10 – 30)<br>
<!--[if !supportLineBreakNewLine]--><br>
<!--[endif]--><o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:.75in;mso-add-space:
auto;text-indent:-.25in;mso-list:l7 level1 lfo4"><!--[if !supportLists]--><span style="font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings">v<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;
</span></span><!--[endif]-->Public methods:<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l4 level1 lfo6"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->Constructor<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l4 level1 lfo6"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->Destructor<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l4 level1 lfo6"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->Copy Constructor<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l4 level1 lfo6"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->LoadADNInformation() : Load DNA information from
a ATGX.bin and store it in m_dna. (Only load the information in ATGX and store
m_dna, it just a sequence and has no special structure).<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l4 level1 lfo6"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->ReduceResistance(medicine_resistance): when a
Patient call TakeMedicine, the medicine has the medicine_resistance and it will
reduce the resistance of virus. If m_resistance of virus &lt;= 0, the virus was
destroyed. The implementing of ReduceResistance is m_resistance = m_resistance
– medicine_resistance;<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l4 level1 lfo6"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->*Note: medicine_resistance will be input from
Patient when he take medicine (it is mentioned in Patient class. (When patient
take medicine, the medicine has its resistance, the medicine resistance help
patient reduce the virus resistance).<br>
<!--[if !supportLineBreakNewLine]--><br>
<!--[endif]--><o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:.75in;mso-add-space:
auto;text-indent:-.25in;mso-list:l7 level1 lfo4"><!--[if !supportLists]--><span style="font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings">v<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;
</span></span><!--[endif]-->Virus is an abstract class with pure virtual
function as bellow:<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l1 level1 lfo7"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->DoBorn: This function represent the virus was
born. It should be call in Constructor in derive class).<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l1 level1 lfo7"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->DoClone: This function represents the new virus
that all its attributes are copied to a new one. DoClone will return a virus
cloned from it. This function can return a Pointer / List of cloned viruses.<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l1 level1 lfo7"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->DoDie: This function represent that the virus
was die. It should be call in the Destructor in derive class).<o:p></o:p></p>

<p class="MsoListParagraphCxSpLast" style="margin-left:1.0in;mso-add-space:auto;
text-indent:-.25in;mso-list:l1 level1 lfo7"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->InitResistance: this function will initialize
the resistance (m_resistance) of virus to medicine and store it in
m_resistance, this method should call in the Constructor of derive class.<o:p></o:p></p>

<h3><a name="_Toc387246619"><!--[if !supportLists]-->b)<span style="font-weight: normal; font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;
</span><!--[endif]-->Flu Virus</a><o:p></o:p></h3>

<p class="MsoListParagraphCxSpFirst" style="margin-left:.75in;mso-add-space:auto;
text-indent:-.25in;mso-list:l12 level1 lfo8"><!--[if !supportLists]--><span style="font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings">v<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;
</span></span><!--[endif]-->Inherit Virus.<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:.75in;mso-add-space:
auto;text-indent:-.25in;mso-list:l12 level1 lfo8"><!--[if !supportLists]--><span style="font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings">v<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;
</span></span><!--[endif]-->Flu virus has some attributes:<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l13 level1 lfo9"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->int m_color: the color of Flu virus is blue
(value 0x0000ff) or red (value 0xff0000)<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:.75in;mso-add-space:
auto;text-indent:-.25in;mso-list:l12 level1 lfo8"><!--[if !supportLists]--><span style="font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings">v<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;
</span></span><!--[endif]-->Override pure virtual function of Virus<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l0 level1 lfo10"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->DoBorn: Call LoadADNInformation() and randomly
initialize Flu m_color.<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l0 level1 lfo10"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->DoClone: This function represents a new virus
that all its attributes are copied to a new one. DoClone will return a virus
that cloned from it. This function can return a Pointer/ /List of cloned viruses.<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l0 level1 lfo10"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->DoDie: release all virus data.<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l0 level1 lfo10"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->InitResistance: Set value for m_resistance.
Random from 10 – 20 for red Flu virus and 10 – 15 for blue Flu virus. Call it
from constructor.<o:p></o:p></p>

<p class="MsoListParagraphCxSpLast" style="margin-left:.75in;mso-add-space:auto"><o:p>&nbsp;</o:p></p>

<h3><a name="_Toc387246620"><!--[if !supportLists]-->c)<span style="font-weight: normal; font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;
</span><!--[endif]-->Dengue virus</a><o:p></o:p></h3>

<p class="MsoListParagraphCxSpFirst" style="margin-left:.75in;mso-add-space:auto;
text-indent:-.25in;mso-list:l5 level1 lfo11"><!--[if !supportLists]--><span style="font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings">v<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;
</span></span><!--[endif]-->Inherit Virus.<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:.75in;mso-add-space:
auto;text-indent:-.25in;mso-list:l5 level1 lfo11"><!--[if !supportLists]--><span style="font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings">v<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;
</span></span><!--[endif]-->Dengue virus has some attributes:<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l0 level1 lfo10"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->char m_protein[4]: protein in virus represent
the type of Dengue virus.<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:.75in;mso-add-space:
auto;text-indent:-.25in;mso-list:l3 level1 lfo12"><!--[if !supportLists]--><span style="font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings">v<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;
</span></span><!--[endif]-->Override pure virtual function of Virus<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l0 level1 lfo10"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->DoBorn: Call LoadADNInformation() and randomly
initialize protein for Dengue Virus (value NS3, NS5, E).<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l0 level1 lfo10"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->DoClone: This function presents virus that all
its attributes are copied to new viruses. Different to DoClone in FluVirus, this
function will return 2 new viruses.<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l0 level1 lfo10"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->DoDie: release all virus data.<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l0 level1 lfo10"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->InitResistance: this function will initialize
the resistance (m_resistance) of virus to medicine and store it in
m_resistance, this method should call in the Constructor of derive class.
Random from 1 – 10 for NS3 protein, 11-20 for NS5 protein and 21-30 for E
protein.<o:p></o:p></p>

<p class="MsoListParagraphCxSpLast" style="margin-left:1.0in;mso-add-space:auto"><o:p>&nbsp;</o:p></p>

<h3><a name="_Toc387246621"><!--[if !supportLists]-->d)<span style="font-weight: normal; font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;
</span><!--[endif]-->About Patient</a><o:p></o:p></h3>

<p class="MsoListParagraphCxSpFirst" style="margin-left:.75in;mso-add-space:auto;
text-indent:-.25in;mso-list:l3 level1 lfo12"><!--[if !supportLists]--><span style="font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings">v<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;
</span></span><!--[endif]-->Patient has some attributes:<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l8 level1 lfo13"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->int m_resistance: his natural resistance.<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l8 level1 lfo13"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->list&lt;Virus*&gt; m_virusList: The current
virus in his body.<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l8 level1 lfo13"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->int m_state: 0 – DIE, 1 - ALIVE<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:.75in;mso-add-space:
auto;text-indent:-.25in;mso-list:l3 level1 lfo12"><!--[if !supportLists]--><span style="font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings">v<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;
</span></span><!--[endif]-->Patient activity:<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l9 level1 lfo14"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->Constructor<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l9 level1 lfo14"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->Destructor<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l9 level1 lfo14"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->InitResistance: Randomly initialize the
resistance of Patient (1000-9000). Call it in Constructor.<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l9 level1 lfo14"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->DoStart: Initialize all virus randomly (around
10 – 20 virus) and add them to m_virusList. Call it in Constructor. Set m_state
= 1<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l9 level1 lfo14"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->TakeMedicine: Iterator virus list and the virus
will call the ReduceResistance(medicine_resistance), the medicine_resistance
random from 1 to 60.<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l9 level1 lfo14"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->If the virus does not die after taking medicine,
it will be cloned and add them to m_virusList, if not remove the virus from
list. <o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l9 level1 lfo14"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->If the m_resistance of Patient is less than the
total virus resistance in m_virusList. Patient DoDie.<o:p></o:p></p>

<p class="MsoListParagraphCxSpMiddle" style="margin-left:1.0in;mso-add-space:
auto;text-indent:-.25in;mso-list:l9 level1 lfo14"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->DoDie: Release all resources (m_virusList). Set
m_state = 0<o:p></o:p></p>

<p class="MsoListParagraphCxSpLast" style="margin-left:1.0in;mso-add-space:auto;
text-indent:-.25in;mso-list:l9 level1 lfo14"><!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
Symbol">·<span style="font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><!--[endif]-->GetState: return m_state<o:p></o:p></p>

<p class="MsoNormal"><o:p>&nbsp;</o:p></p>

<h1 style="text-indent:-.25in;mso-text-indent-alt:-.25in;mso-list:l10 level1 lfo1"><a name="_Toc387246622"><!--[if !supportLists]-->&nbsp; &nbsp;II.<span style="font-weight: normal; font-size: 7pt; font-family: &#39;Times New Roman&#39;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><!--[endif]-->TEST YOUR OOP IMPLEMENTATION</a><o:p></o:p></h1>

<p class="MsoNormal">Use the code below to review your implementation<o:p></o:p></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">#include
&lt;stdio.h&gt;<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">#include
&lt;cstdlib&gt;<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">int
main()<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">{<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Patient p;<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char t = 0;<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (p.GetState() == 1)<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("Take Medicine (0 = NO,
1 = YES");<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scanf("%c", &amp;t);<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (t == 1)<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int min = 1;<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int max = 60;<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int medicine_resistance = min
+ (rand() % (int)(max - min + 1))<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.TakeMedicine(medicine_resistance);<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p>

<p class="MsoNormal" style="margin-bottom: 0.0001pt;"><span style="font-size:
10.0pt;mso-bidi-font-size:8.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">}<o:p></o:p></span></p></div></div>
                    <div class="content exercise-tasks"><div class="item"><input type="checkbox" checked="checked"><label for="exerciseTasks0">No hardcode, following Gameloft coding guildeline</label></div><div class="item"><input type="checkbox" id="exerciseTasks1" onchange="finishTask(490, this);"><label for="exerciseTasks1">Design following OOP architecture</label></div><div class="item"><input type="checkbox" id="exerciseTasks2" onchange="finishTask(491, this);"><label for="exerciseTasks2">Treat all the warnings</label></div><div class="item"><input type="checkbox" id="exerciseTasks3" onchange="finishTask(492, this);"><label for="exerciseTasks3">SVN: write log message clearly</label></div><div class="item"><input type="checkbox" id="exerciseTasks4" onchange="finishTask(493, this);"><label for="exerciseTasks4">SVN: commit when finish a task</label></div></div>
                    <div class="content finish" style="display: none;"><a href="javascript:finishTaskClicked()" class="button">Finish This Task</a></div>
                    <div class="title">Code Review</div>  
                    <div class="content code-reviews"><div class="review"><div class="review-category"></div><div class="review content">To avoid hardcode, You should get the length of string in txt file by below code<div><br></div><div><div>fseek (fp, 0, SEEK_END);</div><div>const int length = ftell(fp);</div><div>fseek (fp, 0, SEEK_SET);</div></div></div><div class="review-state client"><input id="review1074" type="checkbox" onchange="finishCodeReviewClicked(1074, this)"><label for="review1074">I've finished this</label></div></div><div class="review"><div class="review-category"></div><div class="review content">Should set the default value for all attributes in constuctor<div><br></div><div>Ex:</div><div>&nbsp;char* m_dna; --&gt; In constructor: m_dna = NULL;<br></div><div>int m_resistance; --&gt; In constructor: m_resistance = 0;<br></div></div><div class="review-state client"><input id="review1075" type="checkbox" onchange="finishCodeReviewClicked(1075, this)"><label for="review1075">I've finished this</label></div></div><div class="review"><div class="review-category"></div><div class="review content">m_dna is a pointer points to a block of char<div><br></div><div>delete m_dna ----&gt; should change: delete []m_dna;</div><div>It's the same for m_protein</div><div><br></div><div><b>Note:</b></div><div>1. if pointer only allocates memory for an object</div><div>m_dna = new char</div><div><br></div><div>free memory will be: delete m_dna;</div><div><br></div><div>2. if pointer allocates or points to an array of objects</div><div><br></div><div>free memory will be: delete []m_dna;</div></div><div class="review-state client"><input id="review1076" type="checkbox" onchange="finishCodeReviewClicked(1076, this)"><label for="review1076">I've finished this</label></div></div><div class="review"><div class="review-category"></div><div class="review content">strcmp(this-&gt;m_protein,"NS3") returns 0 if 2 strings are the same. Maybe you misunderstand this function?<div><br></div><div><br></div></div><div class="review-state client"><input id="review1077" type="checkbox" onchange="finishCodeReviewClicked(1077, this)"><label for="review1077">I've finished this</label></div></div><div class="review"><div class="review-category"></div><div class="review content">Should put the code after if, else, while, ... into quotes.&nbsp;Please find out in your code all the same thing and fix them.<div><br></div><div>Ex:</div><div><div>if(strcmp(this-&gt;m_protein,"NS3"))</div><div><span class="Apple-tab-span" style="white-space:pre">		</span>this-&gt;m_resistance = rand()%11 + 1;</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>if(strcmp(this-&gt;m_protein,"NS5"))</div><div><span class="Apple-tab-span" style="white-space:pre">		</span>this-&gt;m_resistance = rand()%21 + 11;</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>if(strcmp(this-&gt;m_protein,"E5"))</div><div><span class="Apple-tab-span" style="white-space:pre">		</span>this-&gt;m_resistance = rand()%31 + 21;</div></div><div><br></div><div>--&gt; It should be:</div><div><br></div><div><div>if(strcmp(this-&gt;m_protein,"NS3"))</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">		</span>this-&gt;m_resistance = rand()%11 + 1;</div><div>}</div><div>else if(strcmp(this-&gt;m_protein,"NS5"))</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">		</span>this-&gt;m_resistance = rand()%21 + 11;</div><div>}</div><div>else</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">		</span>this-&gt;m_resistance = rand()%31 + 21;</div></div><div>}</div><div><br></div><div>Note: in this case, using if else instead of if will optimize the performance of your code. It only process one checking.</div><div><br></div></div><div class="review-state client"><input id="review1078" type="checkbox" onchange="finishCodeReviewClicked(1078, this)"><label for="review1078">I've finished this</label></div></div><div class="review"><div class="review-category"></div><div class="review content">Should use a copy constructor to re-use your code<div><br></div><div><div>list&lt;Virus*&gt; DengueVirus::DoClone()const</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>cout&lt;&lt;"DengueVirus clone"&lt;&lt;endl;</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>DengueVirus* _dengueVirus[2];</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>list&lt;Virus*&gt; listDengueVirus;</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>_dengueVirus[0] = new DengueVirus(*this);</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>_dengueVirus[1] = new DengueVirus(*this);</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>listDengueVirus.push_back(_dengueVirus[0]);</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>listDengueVirus.push_back(_dengueVirus[1]);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">	</span>return &nbsp;listDengueVirus;</div><div>}</div></div><div><br></div><div>example:</div><div>1. Define a copy constructor:</div><div><br></div><div>DengueVirus::DengueVirus(const DengueVirus* virus)</div><div>{</div><div>&nbsp;//do something to create new DengueVirus from virus</div><div>}</div><div><br></div><div>2. DoClone(), you just do like this:</div><div><br></div><div>list&lt;Virus*&gt; DengueVirus::DoClone()const<br></div><div>{</div><div>&nbsp; for(int i = 0; i &lt; 2; i++)</div><div>&nbsp;{</div><div>&nbsp; &nbsp; &nbsp; DengueVirus* virus = new DengueVirus(this);</div><div>&nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; //Add virus to list</div><div>&nbsp;}</div><div>&nbsp;</div><div>return list;</div><div>}</div><div><br></div></div><div class="review-state client"><input id="review1079" type="checkbox" onchange="finishCodeReviewClicked(1079, this)"><label for="review1079">I've finished this</label></div></div></div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>

        </div>        
    
</body></html>